package InetAddress;

import java.io.*;
import java.net.Socket;
import java.util.Scanner;


//客户端上传图片到服务端

class TCPClientDemo {


    public static void main(String[] args) throws Exception {
        //建立socket通信管道
        Socket socket = new Socket("127.0.0.1",8888);
        OutputStream os = socket.getOutputStream();
        BufferedOutputStream bos = new BufferedOutputStream(os);   //包装成字节缓冲输出流
        PrintStream ps = new PrintStream(os);//包装成打印流


        while (true)
        {
            System.out.println("请发送消息:");
            Scanner sc = new Scanner(System.in);
            ps.println(sc.nextLine());
            System.out.println("客户端发送完毕===========");
        }


    }
}